<?php

namespace App\Http\Controllers\Service;

use App\Http\Controllers\common\ApiHelper;
use GatewayWorker\Lib\Gateway;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;

class socketService
{

    public static function sendSocketMessage($fid, $type)
    {

        $encode = json_encode($data, true);
        if (!Gateway::isUidOnline($shop_id)) {
            Log::channel('websocket', ["data" => $encode, 'online' => '商户没在线']);
            return true;
        }
        Log::channel('websocket', ["data" => $encode]);
        Gateway::sendToUid($shop_id, $encode);
        return true;
    }

}
